package org.hxd.admin.user.service;

import org.hxd.admin.user.dao.AdminUserDao;
import org.hxd.pojo.ProductList;
import org.hxd.pojo.Products;
import org.hxd.pojo.User;
import org.hxd.utils.PageModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminUserServiceImpl implements AdminUserService {
    @Resource
    AdminUserDao adminUserDao;

    @Override
    public User yLoginuser(User user) {
        return adminUserDao.yLoginuser(user);
    }

    @Override
    public List<Products> findTJproducts(Products products, Double minprice, Double maxprice,PageModel pageModel) {
        return adminUserDao.findTJproducts(products,minprice,maxprice,pageModel);
    }

    @Override
    public int addProducts(Products products) {
        return adminUserDao.addProducts(products);
    }

    @Override
    public int deleteProduct(String id) {
        return adminUserDao.deleteProduct(id);
    }

    @Override
    public int findProductsCount(Products products, Double minprice, Double maxprice) {
        return adminUserDao.findProductsCount(products,minprice,maxprice);
    }

    @Override
    public int updateProduct(Products products) {
        return adminUserDao.updateProduct(products);
    }

    @Override
    public List<ProductList> finProductSalList(String year, String month) {
        return adminUserDao.finProductSalList(year,month);
    }

}
